package Code.MethodWthReturnValue;

//需求：定义方法，比较两个长方形的面积
public class Text1 {
    public static void main(String[] args) {

        //获取面积
        double area1 = getArea(5.3, 1.7);
        double area2 = getArea(2.4, 2.7);

        //比较
        if (area1 > area2) {
            System.out.println("area1大");
        } else {
            System.out.println("area2大");
        }

    }

    //求面积
    public static double getArea(double len, double width) {
        double area = len * width;
        return area;
    }
}
